<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script src="../Ajs/vue.min.js"></script>
</head>
<body>
    <div id="box">
        数值A：<input type="text" v-model="mod1"><br>
        数值B：<input type="text" v-model="mod2"><br>
        <input type="button" value="=" @click="add()"> <br>
        计算结果: <span v-text="num"></span>
    </div>

    <script>
        var vm = new Vue({
            el:"#box",
            data:{
                mod1:'',
                mod2:'',
                num:''
            },
            methods:{
                add(){
                    this.num =  parseInt(this.mod1) + parseInt(this.mod2);
                }
            }
        })
    </script>
</body>
</html>
